function setTokenInfo(access_token, refresh_token) {
    localStorage.setItem('token', access_token)
    localStorage.setItem('refresh_token', refresh_token)
}

function removeTokenInfo() {
    localStorage.removeItem('token')
    localStorage.removeItem('refresh_token')
}

function getUserInfo() {
    const userStr = localStorage.getItem('user')
    return JSON.parse(userStr)
}

function setUserInfo(user) {
    localStorage.setItem('user', JSON.stringify(user))
}

export default {
    setTokenInfo,
    removeTokenInfo,
    getUserInfo,
    setUserInfo
}